﻿/*
     * Created By @ Dzung.NguyenManh    
     * Created Date: 
     * Email:Dzung.nguyenmanh@gmail.com
     * Modidy Date:
     * Compayny : MITC.co
     * Address:
     */
namespace MITC.Portal.Core.Entitys.Configuration.MenuConfg
{
    #region Refrence
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using SPGenesis.Core;
    using SPGenesis.Entities;
    using Microsoft.SharePoint;

    #endregion

    [SPGENListInstance(
        WebRelURL = "Lists/MenuConfig",
        Title ="MenuConfig",
        OnQuickLaunch =false,
        TemplateType = (int)SPListTemplateType.GenericList
    )]
    public class MenuInstance : SPGENListInstance<MenuInstance>
    {
        protected override void InitializeDefinition(SPGENListInstanceProperties properties)
        {
            properties.Fields.ProvisioningMode = SPGENProvisioningMode.ExclusiveAdd;
            properties.Fields.Add<OldParentId>(true, false);
            properties.Fields.Add<ParentId>(true,false);
            properties.Fields.Add<Display>(true,false);
            properties.Fields.Add<OldId>(true,false);
            properties.Fields.Add<OrderId>(true,false);
            properties.Fields.Add<DisplayInTop>(true, false);
            properties.Fields.Add<GroupMenu>(true, false);
            properties.Fields.Add <RelativateUrl>(true, false);
        }

        #region ------------- Field Defined ------------------------
        [SPGENField(AllowMultipleValues = false, ID = "{FF4B07D3-279A-4F74-A1F5-826A02CC4B76}", DisplayName = "kênh cha cũ", Type = SPFieldType.Text, Required = false)]
        public class OldParentId : SPGENField<OldParentId, SPFieldText, string>
        {
        }
        [SPGENField(AllowMultipleValues = false, ID = "{5D2992A4-2795-40A7-8B1D-8C91BB827ED0}", DisplayName = "Kênh cha", Type = SPFieldType.Text, Required = false)]
        public class ParentId : SPGENField<ParentId, SPFieldText, string>
        {
        }
        [SPGENField(AllowMultipleValues = false, ID = "{E482FB8B-D540-421F-9EF8-A44AD7A208E2}", DisplayName = "Hiển thị", Type = SPFieldType.Boolean, Required = false)]
        public class Display : SPGENField<Display, SPFieldBoolean, string>
        {
        }

        [SPGENField(AllowMultipleValues = false, ID = "{E710EFEB-9653-471E-A0D6-B7463B339105}", DisplayName = "Hiển thị trên menutop", Type = SPFieldType.Boolean, Required = false)]
        public class DisplayInTop : SPGENField<DisplayInTop, SPFieldBoolean, bool>
        {
        }
        [SPGENField(AllowMultipleValues = false, ID = "{A63C33EA-AD05-4BC9-8329-022BE9F33B88}", DisplayName = "Id cũ", Type = SPFieldType.Text, Required = false)]
        public class OldId : SPGENField<OldId, SPFieldText, string>
        {
        }
        [SPGENField(AllowMultipleValues = false, ID = "{442AD4B0-1966-41A2-AFB0-70130E6DDB6F}", DisplayName = "Nhóm menu", Type = SPFieldType.Text, Required = false)]
        public class GroupMenu : SPGENField<GroupMenu, SPFieldText, string>
        {
        }
        [SPGENField(AllowMultipleValues = false, ID = "{8B1C0C30-0CC5-41FB-AFD2-364183E924B1}", DisplayName = "Số thứ tự", Type = SPFieldType.Number, Required = false)]
        public class OrderId : SPGENField<OrderId, SPFieldNumber, string>
        {
        }

        [SPGENField(AllowMultipleValues = true, ID = "{A11FDFC8-AF22-44EC-AFA6-43FE5DAFF85B}", DisplayName = "RelativateUrl", Type = SPFieldType.Text, Required = false)]
        public class RelativateUrl : SPGENField<RelativateUrl, SPFieldText, string>
        {
        }

        #endregion
    }
}
